function Control(role){
	//
	this.role = role||"computer";
	
	this.direction=0;
	//是否可移动
	this.movement = {x:0,y:0,speed:2,moveAble:false};
}
Control.DIR_NONE=0;
Control.DIR_UP=1;
Control.DIR_RIGHT=2;
Control.DIR_DOWN=3;
Control.DIR_LEFT=4;
Control.prototype={
	dispose:function(){
		if(this.movement.moveAble){
			switch(this.direction){
				 case Control.DIR_UP:
			    	this.movement.y-=this.movement.speed;
			    	 break
			  	 case Control.DIR_RIGHT:
			    	this.movement.x+=this.movement.speed;
			    	 break
				 case Control.DIR_DOWN:
			    	this.movement.y+=this.movement.speed;
			    	 break 
			  	 case Control.DIR_LEFT :
			    	this.movement.x-=this.movement.speed;
			    	 break
			  	 default:
			    
			}
		}
	},
	setDirection:function(dir){
		this.direction = dir;
	},
	getDirection:function(){
		return this.direction;
	}
}